# BranchListManager - a singleton class that holds the branches that
# may be selected for viewing

require "set"
require "Branch"

class BranchListManager
  def initialize()
    @branch_list = SortedSet.new()
  end

  @@instance = BranchListManager.new()

  def BranchListManager.instance()
    return @@instance
  end

  # takes an integer 'num'
  def addBranch(num)
    @branch_list.add(Branch.new(num))
  end

  def removeBranch(num)
    @branch_list.delete(Branch.new(num))
  end

  def populate()
    addBranch(1118);
    addBranch(1120);
    addBranch(1122);
    addBranch(1124);
    addBranch(1126);
    addBranch(1128);
  end

  private_class_method :new
end
